package cn.lin.task.service;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import cn.lin.task.dao.IAdminDao;
import cn.lin.task.model.Admin;
import cn.lin.task.model.Pager;


@Service("adminService")
public class AdminService implements IAdminService {

	private IAdminDao adminDao;

	public IAdminDao getAdminDao() {
		return adminDao;
	}

	@Resource
	public void setAdminDao(IAdminDao adminDao) {
		this.adminDao = adminDao;
	}

	@Override
	public void add(Admin admin) {
		// TODO Auto-generated method stub
		adminDao.add(admin);
	}

	@Override
	public void delete(int id) {
		// TODO Auto-generated method stub
		adminDao.delete(id);
	}

	@Override
	public void update(Admin admin) {
		// TODO Auto-generated method stub
		adminDao.update(admin);
	}

	@Override
	public Admin load(int id) {
		// TODO Auto-generated method stub
		return adminDao.load(id);
	}

	@Override
	public Admin load(String adminname) {
		// TODO Auto-generated method stub
		return adminDao.load(adminname);
	}

	public Pager<Admin> find(){
		String hql="from Admin admin";
		return adminDao.find(hql);
	}
}
